<base-tree
    #baseTree
    (checkNode)="onCheckNode($event)"
    (selectNode)="onSelectNode($event)"
    [beforeDrop]="beforeDrop.bind(this)"
    [checkStrictly]="true"
    [checkable]="checkable"
    [checkedWhileClick]="checkedWhileClick"
    [customLoadMethod]="customLoadMethod"
    [draggable]="draggable"
    [globalName]="'菜单列表'"
    [maxLevel]="-1"
    [searchConfig]="searchConfig"
    [showRoot]="showRoot"
    [showSearch]="showSearch"
    [showTypeIcon]="true"
    [treeNodeTemplate]="treeNodeTemplate"
    [typeIcon]="typeIcon">
    >
</base-tree>

<ng-template #treeNodeTemplate let-node>
    <span [attr.aria-grabbed]="baseTree.draggable && !node.isDisabled ? true : null" [attr.draggable]="baseTree.draggable && !node.isDisabled ? true : null"
          [class.active]="baseTree.activatedNode?.key === node.key"
          [class.disabled]="node.isDisabled"
          [class.draggable]="baseTree.draggable && !node.isDisabled ? true : null"
          class="tree-node"
          style="display: inline-block;">
        <span style="display: inline-block;">
                   <span *ngIf="node.origin.data.iconId">
                        <img *ngIf="node.origin.data.iconData.indexOf('base64') >= 0 "
                             [src]="node.origin.data.iconData" alt="img" class="menu-node-img">
                        <span *ngIf="node.origin.data.iconData.indexOf('svg') >= 0 "
                              [innerHTML]="getSvgHtml(node.origin.data.iconData)"
                              class="menu-node-svg"></span>
                    </span>
            <i *ngIf="! node.origin.data.iconId" [nzType]="node.origin.type === 'APPLICATION' ? 'dr:hy-application' : node.origin.type === 'MODULE' ? 'dr:hy-module' : 'dr:hy-menu'"
               nz-icon
               theme="fill"></i>
        </span>
        <span class="title-name">{{ node.title }}</span>
    </span>
</ng-template>
